﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TLWindowsEditorWinFormsDemo
{
    /// <summary>
    /// 应用
    /// </summary>
    public static class AppHelper
    {
        public static string LanguageCode = string.Empty;

       
        public static LanguageCodeSettings GetLanguageCodeConfig()
        {
            LanguageCodeSettings settings = ConfigurationManager.GetSection("languageCodeSettings") as LanguageCodeSettings;

            if (settings == null)
            {
                throw new Exception("web.config未配置语言相关信息");
            }
            return settings;
        }

        public static string GetText(string text, string languageCode) 
        {
            return LocalizationService.Instance.GetText(text, languageCode);
        }
        public static string GetText(string text)
        {
            return GetText(text, LanguageCode);
        }
    }
}
